from django.db import models
from frame_server.model import BaseModel

# 附件
class Attach(BaseModel):
    link = models.CharField(max_length=1000, null=True, blank=True, verbose_name="附件地址")
    name = models.CharField(max_length=500, null=True, blank=True, verbose_name="附件名")
    originalName = models.CharField(max_length=500, db_column="original_name", null=True, blank=True, verbose_name="附件原名")
    extension = models.CharField(max_length=12, null=True, blank=True, verbose_name="附件扩展名")
    attachSize = models.PositiveIntegerField(db_column="attach_size", null=True, blank=True, verbose_name="附件大小")

    class Meta:
        db_table = 'system_attach'
        ordering = ['-createTime']
        indexes = [
            models.Index(fields=['extension']),
            models.Index(fields=['originalName']),
            models.Index(fields=['name']),
        ]
